/*
 * commands.h
 *
 *  Created on: Jul 2, 2013
 *      Author: max
 */

#ifndef COMMANDS_H_
#define COMMANDS_H_

#define CLS 0
#define ESE 1
#define ESE_QM 2
#define ESR_QM 3
#define IDN_QM 4
#define OPC 5
#define OPC_QM 6
#define RST 7			// Initialize the UPC.
#define SRE 8
#define SRE_QM 9
#define STB_QM 10
#define TST_QM 11		// Self test. Test valifity of non-volatile RAM. If no error return 0
#define WAI 12			// Wait-to-Continue. Only useful following the :PROG:EXEC:TRANS or *TRG
						//   command. All other commands are executed sequentially as the Program
						//   message is parsed.
// #define *TRG 13		// Executes Transient Events (if any), of currently executed program.
// #define *LLO 14		// Local Lockout. Puts the UPC into Remote mode and disables local operation.
// #define *GTL 15		// GOTO LOCAL. Enables local operation of the UPC keyboard.
// #define *DCL 16		// DEVICE CLEAR. Performs a hardware RESET of the UPC.


#define SYST_ERROR_QM 13
#define SYST_VERS_QM 14

#define STAT_OPER_QM 15
#define STAT_OPER_COND_QM 16
#define STAT_OPER_ENAB 17
#define STAT_OPER_ENAB_QM 18
#define STAT_QUES_QM 19
#define STAT_QUES_COND_QM 20
#define STAT_QUES_ENAB 21
#define STAT_QUES_ENAB_QM 22
#define STAT_PRES 23

#define OUTP 24

#define SOUR_VOLT_ACn 25
#define SOUR_CURR_LIMn 26
#define SOUR_FREQn 27
#define SOUR_RAMPn 28
#define SOUR_PHASn 29
#define SOUR_WAVEFORMn 30

#define SOUR_VOLT_ACn_QM 31
#define SOUR_CURR_LIMn_QM 32
#define SOUR_FREQn_QM 33
#define SOUR_RAMPn_QM 34
#define SOUR_PHASn_QM 35
#define SOUR_WAVEFORMn_QM 36

#define MEAS_VOLT_RMSn_QM 37
#define MEAS_VLLn_QM 38
#define MEAS_FREQn_QM 39
#define MEAS_CURR_RMSn_QM 40
#define MEAS_CURR_PEAKn_QM 41
#define MEAS_CURR_RESTn_QM 42
#define MEAS_POWn_QM 43
#define MEAS_KVAn_QM 44
#define MEAS_PFn_QM 45

#define SOUR_VOLT_DCn 46
#define SOUR_VOLT_DCn_QM 47
#define MEAS_VOLT_DCn_QM 48
#define MEAS_VOLT_ACn_QM 49
#define MEAS_CURR_DCn_QM 50
#define MEAS_CURR_ACn_QM 51

/*
 * PROGRAM MEMORY CONTROL
 *
 * #define PROG_NAME 		52	// Selects program "n" for executing, deleting, or copying
 * #define PROG_DEF			53	// Defines the values stored in program "n".
 * #define PROG_DEL			54	// Deletes selected program.
 * #define PROG_DEL_ALL		55	// Deletes all programs, waveforms, calibration data and setup values. Performs device RESET
 * #define PROG_COPY		56	// Copies the selected program to <dest> = 1 to 99
 * #define PROG_CAT_QM		57	// Returns a comma separated list of NR1 values representing stored programs.
 *
 * SIGNAL CONTROL
 *
 * #define PROG_EXEC		58	// Executes selected Program steady-state values.
 * #define PROG_EXEC_TRANS	59	//
 *
 *
 *
*/
#define ERR_TOO_MANY_NUM_SUF 	52
#define ERR_NO_COMMAND 			53
#define ERR_NUM_SUF_INVALID 	54
#define ERR_INVALID_VALUE 		55
#define ERR_INVALID_DIMS 		56
#define ERR_PARAM_OVERFLOW 		57
#define ERR_PARAM_UNITS 		58
#define ERR_PARAM_TYPE 			59
#define ERR_PARAM_COUNT 		60
#define ERR_UNMATCHED_QUOTE		61
#define ERR_UNMATCHED_BRACKET 	62
#define ERR_INVALID_CMD 		63
#define ERR_NO_ENTRY 			64
#define ERR_TOO_MANY_DIMS 		65

#define TOTAL_CMDS_FUNCTIONS	65

struct Arguments_1_Double
{
	int suffix;
	double arg1;
};

struct Arguments_2_Doubles
{
	int suffix;
	double arg1;
	double arg2;
};

struct Arguments_1_Int
{
	int suffix;
	int arg1;
};

struct Arguments_2_Ints
{
	int suffix;
	int arg1;
	int arg2;
};

#endif /* COMMANDS_H_ */
